package com.ayz.gateway.core.session.executor;

import com.ayz.gateway.common.result.GatewayResult;
import com.ayz.gateway.core.rpc.RemotingResponseCallback;

/**
 * @ClassName AbstractExecutor
 * @Description TODO: 抽象的执行器
 * @Author 快乐的星球
 * @Date 2023/5/10 18:13
 * @Version 1.0
 **/
public abstract class AbstractExecutor implements Executor{
    /**
     * 将GatewayResult交由响应回调函数处理通过Netty返回给客户端
     * @param gatewayResult
     * @param callback
     */
    public void handleResult(GatewayResult gatewayResult, RemotingResponseCallback callback){
        callback.callback(gatewayResult);
    }
}
